<?php
/**
 *---------------------------------------------------------------
 * 檔案名稱: reg.php
 * 類別功能: 註冊頁。 
 *---------------------------------------------------------------
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Reg extends CI_Controller {
	
	function __construct() {
		parent::__construct();
		$this->load->helper(array('form','url'));
		$this->load->library('form_validation');
	}
	
	
	function index(){
		
		$this->form_validation->set_rules('login','帳號','trim|required|min_length[6]|max_length[12]|xss_clean');
		$this->form_validation->set_rules('pass','密碼','trim|required|min_length[6]|max_length[12]|matches[passconf]|md5');
		/*
		if($this->form_validation->run() == FALSE){
			$this->load->view('frontend/reg');
		}else{
			
			$this->load->database();
			
			$sql = "SELECT login,name FROM `ci_member` WHERE `login`=? AND `pass`=? ";
			$qry = $this->db->query($sql,array($_POST['login'],$_POST['pass']));
			
			foreach($qry->result as $row){
				echo $row->login;
			}
			
			
			redirect('frontend/home');
		}*/
	    	
	}
	
	
}


//*** 結束reg.php ***// 